package com.ssm.Dao;

import com.ssm.Service.findShopNumber;
import com.ssm.Utils.DBCPUtils;

public class saveShopDao {

    public boolean save(int userId, String pic) {

        findShopNumber findShopNumber=new findShopNumber();
        boolean b=false;
        boolean num = findShopNumber.findNum(userId,pic);

        String sql_insert="insert into shop(u_id,c_pic,c_number) values(?,?,?)";

        Object[] objects={userId,pic,1};
        if(!num){
            b = DBCPUtils.executeUpdate(sql_insert, objects);
        }
        return b;
    }
}
